package com.yanqu.road.entity.activity.daomu;

import sun.applet.Main;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DaoMuBattlePropItem {

    //局内道具唯一ID
    private int battlePropId;

    //局内道具配置ID
    private int curioId;

    //是否可使用
    private boolean usableFlag;

    //来源类型
    private int sourceType;

    //来源id
    private int sourceId;

    public DaoMuBattlePropItem(int battlePropId, int curioId, boolean usableFlag, int sourceType, int sourceId) {
        this.battlePropId = battlePropId;
        this.curioId = curioId;
        this.usableFlag = usableFlag;
        this.sourceType = sourceType;
        this.sourceId = sourceId;
    }

    public int getBattlePropId() {
        return battlePropId;
    }

    public int getCurioId() {
        return curioId;
    }

    public int getSourceType() {
        return sourceType;
    }

    public int getSourceId() {
        return sourceId;
    }

    public boolean isUsableFlag() {
        return usableFlag;
    }

    public void setUsableFlag(boolean usableFlag) {
        this.usableFlag = usableFlag;
    }



    /**
     * 使用道具
     * @return
     */
    public boolean use() {
        if (this.isUsableFlag()) {
            this.setUsableFlag(false);
            return true;
        }
        return false;
    }
}
